<?php
/**
 * Created by IntelliJ IDEA
 * Author: 张伯发
 * Date  : 2019/11/18
 * Time  : 23:09
 */

namespace App\Controller;


use Swoft\Http\Message\Request;
use Swoft\Http\Server\Annotation\Mapping\Controller;
use Swoft\Http\Server\Annotation\Mapping\RequestMapping;
use Swoft\Http\Server\Annotation\Mapping\RequestMethod;
use Xiaoproject\Common\Base\BaseResponseDTO;

/**
 * Class HomeController
 * @author 张伯发 2019/11/18 23:10
 * @Controller(prefix="home")
 */
class HomeController
{
    /**
     * @author 张伯发 2019/11/18 23:11
     * @RequestMapping(method={RequestMethod::GET}, route="getList")
     */
    public function getList(Request $request) : array
    {

        $name = $request->get('name');
        vdump($name);
        return (new BaseResponseDTO())->setData(['username' => 'hello'])->toJson();
    }
}
